<html>
<head><meta charset="utf-8"><title>UI tests woes [solved] · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/UI.20tests.20woes.20.5Bsolved.5D.html">UI tests woes [solved]</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="194596990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/UI%20tests%20woes%20%5Bsolved%5D/near/194596990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kornel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/UI.20tests.20woes.20.5Bsolved.5D.html#194596990">(Apr 19 2020 at 13:11)</a>:</h4>
<p>I'm trying to add a help line to an existing error message, and I'm running into issues:</p>
<ul>
<li><code>--bless</code> doesn't update all of UI tests. </li>
<li><code>tidy</code> rejects my PR because a comment that checks the error message exceeds line length</li>
</ul>



<a name="194597003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/UI%20tests%20woes%20%5Bsolved%5D/near/194597003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kornel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/UI.20tests.20woes.20.5Bsolved.5D.html#194597003">(Apr 19 2020 at 13:11)</a>:</h4>
<div class="codehilite"><pre><span></span>unexpected errors (from JSON output): [
    Error {
        line_num: 3,
        kind: Some(
            Help,
        ),
        msg: &quot;3:1: 3:21: if there is `mod not_a_real_file` elsewhere in the crate already, import it with `use crate::` instead&quot;,
    },
]

not found errors (from test file): [
    Error {
        line_num: 4,
        kind: Some(
            Help,
        ),
        msg: &quot;if there is `mod not_a_real_file` elsewhere in the crate already&quot;,
    },
]

thread &#39;[ui] ui/parser/mod_file_not_exist.rs&#39; panicked at &#39;explicit panic&#39;, src/tools/compiletest/src/runtest.rs:1460:13
</pre></div>



<a name="194597051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/UI%20tests%20woes%20%5Bsolved%5D/near/194597051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kornel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/UI.20tests.20woes.20.5Bsolved.5D.html#194597051">(Apr 19 2020 at 13:12)</a>:</h4>
<p>and the file is:</p>
<div class="codehilite"><pre><span></span>// ignore-windows

mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
//~^ HELP to create the module `not_a_real_file` here, create file
//~^ HELP if there is `mod not_a_real_file` elsewhere in the crate already

fn main() {
    assert_eq!(mod_file_aux::bar(), 10);
    //~^ ERROR failed to resolve: use of undeclared type or module `mod_file_aux`
}
</pre></div>



<a name="194597068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/UI%20tests%20woes%20%5Bsolved%5D/near/194597068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/UI.20tests.20woes.20.5Bsolved.5D.html#194597068">(Apr 19 2020 at 13:12)</a>:</h4>
<p>the second <code>//~^ HELP</code> needs to be <code>//~| HELP</code></p>



<a name="194597071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/UI%20tests%20woes%20%5Bsolved%5D/near/194597071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kornel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/UI.20tests.20woes.20.5Bsolved.5D.html#194597071">(Apr 19 2020 at 13:12)</a>:</h4>
<p>Can I have two <code>//~^ HELP</code> lines per error? Are they searching for a substring, or do they have to be an exact match?</p>



<a name="194597076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/UI%20tests%20woes%20%5Bsolved%5D/near/194597076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/UI.20tests.20woes.20.5Bsolved.5D.html#194597076">(Apr 19 2020 at 13:13)</a>:</h4>
<p><code>^</code> means "should appear on the line above this one"</p>



<a name="194597080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/UI%20tests%20woes%20%5Bsolved%5D/near/194597080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/UI.20tests.20woes.20.5Bsolved.5D.html#194597080">(Apr 19 2020 at 13:13)</a>:</h4>
<p><code>|</code> means "should appear on the same line as the above pattern"</p>



<a name="194597099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/UI%20tests%20woes%20%5Bsolved%5D/near/194597099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kornel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/UI.20tests.20woes.20.5Bsolved.5D.html#194597099">(Apr 19 2020 at 13:13)</a>:</h4>
<p>Thanks</p>



<a name="194598425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/UI%20tests%20woes%20%5Bsolved%5D/near/194598425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/UI.20tests.20woes.20.5Bsolved.5D.html#194598425">(Apr 19 2020 at 13:44)</a>:</h4>
<p>also see <a href="https://rustc-dev-guide.rust-lang.org/tests/adding.html#error-annotations" title="https://rustc-dev-guide.rust-lang.org/tests/adding.html#error-annotations">https://rustc-dev-guide.rust-lang.org/tests/adding.html#error-annotations</a></p>



<a name="194599734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/UI%20tests%20woes%20%5Bsolved%5D/near/194599734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/UI.20tests.20woes.20.5Bsolved.5D.html#194599734">(Apr 19 2020 at 14:15)</a>:</h4>
<p>there's also <code>// ignore-tidy-linelength</code></p>



<a name="194619490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/UI%20tests%20woes%20%5Bsolved%5D/near/194619490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/UI.20tests.20woes.20.5Bsolved.5D.html#194619490">(Apr 19 2020 at 21:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/122651-general/topic/UI.20tests.20woes/near/194599734" title="#narrow/stream/122651-general/topic/UI.20tests.20woes/near/194599734">said</a>:</p>
<blockquote>
<p>there's also <code>// ignore-tidy-linelength</code></p>
</blockquote>
<p>which should almost never be used in UI tests</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>